<% remote_form_for :computer, :url => {:action => :remote_operation, :id => @computer.id}, :complete => "$('addOperationForm').hide();" do |f| %>
<div class="marged"> 
 <h1><%=h @computer.name %></h1>
  <p>
	  <h3>Operation available</h3>
	  <div id='trash_operation' class="computerList ui-state-default ui-corner ui-corner-all">
	     <% Operation.all.each do |operation| %>
	  	   <%if !@computer.operations.include?(operation)%>
		     <%= render :partial => 'computers/computer_operation', :locals => {:operation => operation}%>
	  	   <%end%>
		 <% end %>
	  </div>
	  <h3>Operation that belongs to me</h3>
	  <div id='container_operation' class="computerList ui-state-default ui-corner ui-corner-all">
		<% Operation.all.each do |operation| %>
			<%if @computer.operations.include?(operation)%>
			  <%= render :partial => 'computers/computer_operation', :locals => {:operation => operation}%>
			<%end%>
		<%end%>
	  </div>
  </p>
	<%= f.label :status %>
	<%= f.select(:status, Computer::COMPUTER_STATUS.map {|c| [c[1], c[0]]}, :selected => @computer.status)%>
	  <%= drop_receiving_element('trash_operation',
	:accept => "dragable",
	:with   => "'operation_id=' + (element.id.split('_').last()) + '&computer_id=#{@computer.id.to_s}'",
	    :url    => {:controller=>:computers,:action=>:delete_operation}
	  )%>
	  <%= drop_receiving_element('container_operation',
	:accept => "dragable",
	:with   => "'operation_id=' + (element.id.split('_').last()) + '&computer_id=#{@computer.id.to_s}'",
	    :url    => {:controller=>:computers,:action=>:add_operation}
	  )%>
	<%= f.submit 'Update' %>
</div>
<% end -%>